package day07;

public class PrimeNumber {
    public static void main(String[] args) {
        /*
        System.out.println("素数有：");
        for(int num = 2;num<=1000;num++){
        boolean flag = true;
        for(int i=2;i<=num/2;i++){
            if(num%i==0){
                flag = false;
                break;
            }
        }
        if(flag){
            System.out.print(num+"\t");
            }
        }

         */
        System.out.println("素数有:");
        for(int num = 2;num<=100;num++){
            boolean flag = true;
            for (int i=2;i<=num/2;i++){
                if(num%i == 0){
                    flag = false;
                    break;
                }
            }
            if (flag){
                System.out.print(num+"\t");
            }
        }
    }

}
